home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Online / Apache / lib / php / build / fastgen.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2001-03-06  |  2.3 KB  |  77 lines

  1. #! /bin/sh
  2. #
  3. #  +----------------------------------------------------------------------+
  4. #  | PHP version 4.0                                                      |
  5. #  +----------------------------------------------------------------------+
  6. #  | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group                   |
  7. #  +----------------------------------------------------------------------+
  8. #  | This source file is subject to version 2.02 of the PHP license,      |
  9. #  | that is bundled with this package in the file LICENSE, and is        |
  10. #  | available at through the world-wide-web at                           |
  11. #  | http://www.php.net/license/2_02.txt.                                 |
  12. #  | If you did not receive a copy of the PHP license and are unable to   |
  13. #  | obtain it through the world-wide-web, please send a note to          |
  14. #  | license@php.net so we can mail you a copy immediately.               |
  15. #  +----------------------------------------------------------------------+
  16. #  | Authors: Sascha Schumann <sascha@schumann.cx>                        |
  17. #  +----------------------------------------------------------------------+
  18. #
  19. # $Id: fastgen.sh,v 1.9 2000/09/26 11:19:38 sas Exp $ 
  20. #
  21.  
  22. srcdir=$1
  23. shift
  24.  
  25. mkdir_p=$1
  26. shift
  27.  
  28. bsd_makefile=$1
  29. shift
  30.  
  31. top_srcdir=`(cd $srcdir; pwd)`
  32. top_builddir=`pwd`
  33.  
  34. if test "$mkdir_p" = "yes"; then
  35.   mkdir_p="mkdir -p"
  36. else
  37.   mkdir_p="$top_srcdir/helpers/mkdir.sh"
  38. fi
  39.  
  40. if test "$bsd_makefile" = "yes"; then
  41.   (cd $top_srcdir; ./build/bsd_makefile)
  42.  
  43.   for makefile in $@; do
  44.     echo "creating $makefile"
  45.     dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
  46.     $mkdir_p "$dir/"
  47.  
  48.     cat - $top_srcdir/$makefile.in <<EOF |sed 's/^include \(.*\)/.include "\1"/' >$makefile 
  49. top_srcdir   = $top_srcdir
  50. top_builddir = $top_builddir
  51. srcdir       = $top_srcdir/$dir
  52. builddir     = $top_builddir/$dir
  53. VPATH        = $top_srcdir/$dir
  54. EOF
  55.  
  56.     test -z "$dir" && dir=.
  57.     touch $dir/.deps
  58.   done
  59. else  
  60.   for makefile in $@; do
  61.     echo "creating $makefile"
  62.     dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
  63.     $mkdir_p "$dir/"
  64.  
  65.     cat - $top_srcdir/$makefile.in <<EOF >$makefile
  66. top_srcdir   = $top_srcdir
  67. top_builddir = $top_builddir
  68. srcdir       = $top_srcdir/$dir
  69. builddir     = $top_builddir/$dir
  70. VPATH        = $top_srcdir/$dir
  71. EOF
  72.   
  73.     test -z "$dir" && dir=.
  74.     touch $dir/.deps
  75.   done
  76. fi
  77.